import { User } from '@/api/user/type';
import { http } from '@/core/http';

export const userLogin = (data: User.ILoginRequest) => {
  return http.post<User.ILoginResponse>({
    url: 'user/login',
    data
  });
};
export const userRegistry = (data: User.IRegistryRequest) => {
  return http.post<User.IRegistryResponse>({
    url: 'user/registry',
    data
  });
};
export const userInfo = () => {
  return http.get<User.IUserInfoResponse>({
    url: 'user/info',
    isLoading: false
  });
};
export const updateUserInfo = (
  data: User.IUserInfoRequest
) => {
  return http.put({
    url: 'user/info',
    data,
    isLoading: false,
    isShowSuccessText: true
  });
};
export const userLogout = () => {
  return http.get({
    url: 'user/logout'
  });
};
